package com.bestcem.xm.ticket.service.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.*;

/**
 * 奖励通知提醒DTO
 *
 * @author sh.pei <sh.pei@idiaoyan.com>
 * @version v1.0
 * @date 2021/8/2 13:59
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class TicketNotificationTriggerDTO {

    /**
     *total_num = await get_award_total_num_by_award(award)
     *     if total_num == award.get("cur_count"):
     *         # 发送奖励通知提醒
     *         if award['ttype'] == model_enums.AWARD_TTYPE_BONUS:
     *             n_type = enums.NOTIFICATION_TYPE_BONUS_AWARD
     *         elif award['ttype'] == model_enums.AWARD_TTYPE_DRAW:
     *             n_type = enums.NOTIFICATION_TYPE_DRAW_AWARD
     *         else:
     *             return
     *         params = {
     *             "project_id": award['qdes_id'],
     *             "n_type_tag": award_id,
     *             "n_type": n_type,
     *             "count": total_num
     *         }
     *         logger.info(f"发送奖励通知{params}")
     *         await redis_mq.publish(topics.ticket_notification_trigger, params)
     */

    /**
     * 项目id project_id
     */
    @JsonProperty("project_id")
    private String projectId;

    /**
     * 奖励id n_type_tag
     */
    @JsonProperty("n_type_tag")
    private String nTypeTag;

    /**
     * 通知类型 参见: {@link com.bestcem.xm.ticket.enums.NotificationTypeEnum}
     * n_type
     */
    @JsonProperty("n_type")
    private Integer nType;

    /**
     * 总数量
     */
    private Integer count;
}
